class ScheduleEntity {
  int? isCurrent;
  List<Schedules>? schedules;
  int? matchTime;
  int? round;
  String? roundName;
  int? matchLocation;
  int? recordType;

  ScheduleEntity({
    this.isCurrent,
    this.schedules,
    this.matchTime,
    this.round,
    this.roundName,
    this.matchLocation,
    this.recordType
  });

  ScheduleEntity.fromSoccer(Map<String, dynamic> json) {
    isCurrent = json['isCurrent'];
    if (json['list'] != null) {
      schedules = <Schedules>[];
      json['list'].forEach((v) {
        schedules!.add(new Schedules.fromSoccer(v));
      });
    }
    matchTime = json['matchTime'];
    // round = json['round'];
    roundName = json['round'];
    matchLocation = json['matchLocation'];
    recordType = 0;
  }

  ScheduleEntity.fromBasketball(Map<String, dynamic> json) {
    isCurrent = json['isCurrent'];
    if (json['appTeamMatchInfo'] != null) {
      schedules = <Schedules>[];
      json['appTeamMatchInfo'].forEach((v) {
        schedules!.add(new Schedules.fromBasketball(v));
      });
    }
    matchTime = json['matchTime'];
    round = json['kind'];
    roundName = json['kindName'];
    matchLocation = json['matchLocation'];
    recordType = 1;
  }

  Map<String, dynamic> toJsonSoccer() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['isCurrent'] = this.isCurrent;
    if (this.schedules != null) {
      data['list'] = this.schedules!.map((v) => v.toJsonSoccer()).toList();
    }
    data['matchTime'] = this.matchTime;
    data['round'] = this.round;
    return data;
  }

  Map<String, dynamic> toJsonBasketball() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['isCurrent'] = this.isCurrent;
    if (this.schedules!= null) {
      data['appTeamMatchInfo'] = this.schedules!.map((v) => v.toJsonBasketball()).toList();
    }
    data['matchTime'] = this.matchTime;
    data['kind'] = this.round;
    data['kindName'] = this.roundName;
    data['matchLocation'] = this.matchLocation;
    return data;
  }
}

class Schedules{
  int? leftId;
  String? leftLogo;
  String? leftName;
  int? leftScoreEnd;
  int? leftScoreHalf;
  int? leftScorePK;
  int? leftScoreOT;
  int? rightId;
  String? rightLogo;
  String? rightName;
  int? rightScoreEnd;
  int? rightScoreHalf;
  int? rightScorePK;
  int? rightScoreOT;
  int? leagueId;
  String? leagueName;
  String? round;
  int? status;
  int? matchId;
  String? matchTime;

  Schedules({
    this.leftId,
    this.leftLogo,
    this.leftName,
    this.leftScoreEnd,
    this.leftScoreHalf,
    this.leftScorePK,
    this.leftScoreOT,
    this.rightId,
    this.rightLogo,
    this.rightName,
    this.rightScoreEnd,
    this.rightScoreHalf,
    this.rightScorePK,
    this.rightScoreOT,
    this.leagueId,
    this.leagueName,
    this.round,
    this.status,
    this.matchId,
    this.matchTime});

  Schedules.fromSoccer(Map<String, dynamic> json) {
    leftId = json['homeId'];
    leftLogo = json['homeLogo'];
    leftName = json['homeName'];
    leftScoreEnd = json['homeScore90'];
    leftScoreHalf = json['homeScoreHalf'];
    leftScoreOT = json['homeScoreOt'];
    leftScorePK = json['homeScorePk'];
    rightId = json['guestId'];
    rightLogo = json['guestLogo'];
    rightName = json['guestName'];
    rightScoreEnd = json['guestScore90'];
    rightScoreHalf = json['guestScoreHalf'];
    rightScoreOT = json['guestScoreOt'];
    rightScorePK = json['guestScorePk'];
    leagueId = json['leagueId'];
    leagueName = json['leagueName'];
    round = json['round'];
    status = json['status'];
    matchId = json['matchId'];
    matchTime = json['matchTime'];
  }

  Schedules.fromBasketball(Map<String, dynamic> json) {
    leftId = json['awayTeamId'];
    leftLogo = json['awayLogo'];
    leftName = json['awayName'];
    leftScoreEnd = json['awayScore'];
    rightId = json['homeTeamId'];
    rightLogo = json['homeLogo'];
    rightName = json['homeName'];
    rightScoreEnd = json['homeScore'];
    leagueId = json['leagueId'];
    leagueName = json['leagueName'];
    status = json['statusId'];
    matchId = json['id'];
    matchTime = json['matchTime'];
  }

  Map<String, dynamic> toJsonSoccer() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['homeId'] = this.leftId;
    data['homeLogo'] = this.leftLogo;
    data['homeName'] = this.leftName;
    data['homeScore90'] = this.leftScoreEnd;
    data['homeScoreHalf'] = this.leftScoreHalf;
    data['homeScoreOt'] = this.leftScoreOT;
    data['homeScorePk'] = this.leftScorePK;
    data['guestId'] = this.rightId;
    data['guestLogo'] = this.rightLogo;
    data['guestName'] = this.rightName;
    data['guestScore90'] = this.rightScoreEnd;
    data['guestScoreHalf'] = this.rightScoreHalf;
    data['guestScoreOt'] = this.rightScoreOT;
    data['guestScorePk'] = this.rightScorePK;
    data['leagueId'] = this.leagueId;
    data['leagueName'] = this.leagueName;
    data['round'] = this.round;
    data['status'] = this.status;
    data['matchId'] = this.matchId;
    data['matchTime'] = this.matchTime;
    return data;
  }

  Map<String, dynamic> toJsonBasketball() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['homeId'] = this.leftId;
    data['homeLogo'] = this.leftLogo;
    data['homeName'] = this.leftName;
    data['homeScore'] = this.leftScoreEnd;
    data['awayId'] = this.rightId;
    data['awayLogo'] = this.rightLogo;
    data['awayName'] = this.rightName;
    data['awayScore'] = this.rightScoreEnd;
    data['leagueId'] = this.leagueId;
    data['leagueName'] = this.leagueName;
    data['statusId'] = this.status;
    data['id'] = this.matchId;
    data['matchTime'] = this.matchTime;
    return data;
  }


}